﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;
using nERP.Model.Wms;
using nERP.Model.Bas;

namespace nERP.Model.Wms
{
    /// <summary>
    /// 其它入库明细
    /// </summary>
	[Table("OtherInWarehouseDetail")]
    [SoftKey(nameof(OtherInWarehouseDetail.OtherInWarehouseDetailCode))]
    [Display(Name = "_Model.OtherInWarehouseDetail")]
    public class OtherInWarehouseDetail : BasePoco,ITenant
    {
        [Display(Name = "_Model._OtherInWarehouseDetail._Seq")]
        [Comment("序号")]
        public int? Seq { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._OtherInWarehouseDetailCode")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("入库明细单号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string OtherInWarehouseDetailCode { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._OtherInWarehouse")]
        [Comment("其他入库")]
        [NotMapped]
        public OtherInWarehouse OtherInWarehouse { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._OtherInWarehouse")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("其他入库")]
        public string OtherInWarehouseId { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._Warehouse")]
        [Comment("仓库")]
        [NotMapped]
        public Warehouse Warehouse { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._Warehouse")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("仓库")]
        public string WarehouseId { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._Goods")]
        [Comment("商品")]
        [NotMapped]
        public Goods Goods { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._Goods")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("商品")]
        public string GoodsId { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._GoodsName")]
        [StringLength(64, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("商品名称")]
        public string GoodsName { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._GoodsSpec")]
        [StringLength(64, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("商品规格")]
        public string GoodsSpec { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._GoodsUnit")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("计量单位")]
        public string GoodsUnit { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._OtherInNumber")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("入库数量")]
        public decimal? OtherInNumber { get; set; }
        [Display(Name = "_Model._OtherInWarehouseDetail._Status")]
        [Comment("状态")]
        public dStatusTypeEnum? Status { get; set; } = dStatusTypeEnum.Unaudited;
        [Display(Name = "_Model._OtherInWarehouseDetail._Remark")]
        [StringLength(256, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("备注")]
        public string Remark { get; set; }
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
